package org.jsola.hr.web;

import org.jsola.admin.vo.FunctionModularVO;
import org.jsola.core.Result;
import org.jsola.hr.constant.HrConstants;
import org.jsola.hr.provider.IModularProviderService;
import org.jsola.hr.query.HrFunctionModularQueryDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * @author zhr
 */
@RestController("hrFunctionModularController")
@RequestMapping(HrConstants.API_PATH + "/v1/modular")
public class HrFunctionModularController implements IHrFunctionModularControllerAPI {

    @Autowired
    private IModularProviderService modularProviderService;

    @Override
    @GetMapping("/list")
    public Result<List<FunctionModularVO>> listByApp(@Valid HrFunctionModularQueryDTO hrFunctionModularQueryDTO) {
        return Result.success(modularProviderService.listByApp(hrFunctionModularQueryDTO));
    }
}
